/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.modular.xylogylogs.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.xylogylogs.param.XyLogyLogsParam;
import vip.xiaonuo.modular.xylogylogs.service.XyLogyLogsService;
import vip.xiaonuo.modular.xylogylogs.entity.XyLogyLogs;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
import vip.xiaonuo.sys.core.msg.Result;
import static vip.xiaonuo.sys.core.msg.ResultUtils.success;
/**
 * 操作族谱日志表控制器
 *
 * @author yanwei
 * @date 2023-05-05 15:44:28
 */
@RestController
@Api(tags = "后台管理 操作族谱日志表 相关APIS")
@AdminVersionSwagger
public class XyLogyLogsController {

    @Resource
    private XyLogyLogsService xyLogyLogsService;

    /**
     * 查询操作族谱日志表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyLogyLogs/page")
    @BusinessLog(title = "操作族谱日志表_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("操作族谱日志表_查询")
    public Result<PageResult<XyLogyLogs>> page(XyLogyLogsParam xyLogyLogsParam) {
        PageResult<XyLogyLogs> page = xyLogyLogsService.page(xyLogyLogsParam);
        return success(page);
    }

    /**
     * 添加操作族谱日志表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyLogyLogs/add")
    @BusinessLog(title = "操作族谱日志表_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("操作族谱日志表_增加")
    public Result add(@RequestBody @Validated(XyLogyLogsParam.add.class) XyLogyLogsParam xyLogyLogsParam) {
            xyLogyLogsService.add(xyLogyLogsParam);
        return success();
    }

    /**
     * 删除操作族谱日志表，可批量删除
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyLogyLogs/delete")
    @BusinessLog(title = "操作族谱日志表_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("操作族谱日志表_删除")
    public Result delete(@RequestBody @Validated(XyLogyLogsParam.delete.class) List<XyLogyLogsParam> xyLogyLogsParamList) {
            xyLogyLogsService.delete(xyLogyLogsParamList);
        return success();
    }

    /**
     * 编辑操作族谱日志表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyLogyLogs/edit")
    @BusinessLog(title = "操作族谱日志表_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("操作族谱日志表_编辑")
    public Result edit(@RequestBody @Validated(XyLogyLogsParam.edit.class) XyLogyLogsParam xyLogyLogsParam) {
            xyLogyLogsService.edit(xyLogyLogsParam);
        return success();
    }

    /**
     * 查看操作族谱日志表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyLogyLogs/detail")
    @BusinessLog(title = "操作族谱日志表_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("操作族谱日志表_查看")
    public Result<XyLogyLogs> detail(@Validated(XyLogyLogsParam.detail.class) XyLogyLogsParam xyLogyLogsParam) {
        XyLogyLogs detail =   xyLogyLogsService.detail(xyLogyLogsParam);
        return success(detail);
    }

    /**
     * 操作族谱日志表列表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyLogyLogs/list")
    @BusinessLog(title = "操作族谱日志表_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("操作族谱日志表_列表")
    public Result<List<XyLogyLogs>> list(XyLogyLogsParam xyLogyLogsParam) {
        List<XyLogyLogs> list  =   xyLogyLogsService.list(xyLogyLogsParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyLogyLogs/export")
    @BusinessLog(title = "操作族谱日志表_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("操作族谱日志表_导出")
    public void export(XyLogyLogsParam xyLogyLogsParam) {
        xyLogyLogsService.export(xyLogyLogsParam);
    }

}
